// 用户信息接口
export interface UserInfo {
  id: number;
  name: string;
  nickname: string;
  avatar: string;
  college: string;
  major: string;
  grade: string;
}

// 用户详细信息接口（用于帖子详情页）
export interface UserVO {
  id: number;
  nickname: string;
  userAvatar: string;
  major: string;
  grade: string;
  college: string;
}

// 帖子统计数据接口
export interface PostStats {
  likes: number;
  comments: number;
  shares: number;
  favourites: number;
}

// 帖子数据接口
export interface PostData {
  id: number;
  user: UserInfo;
  content: string;
  tags: string[];
  images: string[];
  createTime: string;
  updateTime?: string;
  stats: PostStats;
  isLiked: boolean;
  isFavorited: boolean;
  title?: string;
}

// 帖子详情接口（对应后端PostDetailVO）
export interface PostDetailVO {
  id: number;
  title: string;
  content: string;
  summary: string;
  tags: string[];
  images: string[];
  thumbNum: number;
  favourNum: number;
  commentNum: number;
  createTime: string;
  updateTime: string;
  user: UserVO;
  hasThumb: boolean;
  hasFavour: boolean;
}

// 帖子列表请求参数接口
export interface PostListParams {
  current: number;
  pageSize: number;
  sortField?: string;
  sortOrder?: 'ascend' | 'descend';
  searchText?: string;
  tags?: string[];
}

// 帖子列表响应接口
export interface PostListResponse {
  records: PostData[];
  total: number;
  size: number;
  current: number;
  pages: number;
}

// 创建帖子请求参数接口
export interface CreatePostParams {
  title?: string;
  content: string;
  tags?: string[];
  images?: string[];
}

// 编辑帖子请求参数接口
export interface EditPostParams {
  id: number;
  title?: string;
  content?: string;
  tags?: string[];
  images?: string[];
}

// API响应基础接口
export interface ApiResponse<T = any> {
  code: number;
  data: T;
  message: string;
} 